// Filename: views/person/deletePerson
define([
  'jquery',
  'underscore',
  'backbone',
  // Pull in the Model from above
  'models/user'
], function($, _, Backbone, UserModel){
	var PersonDeleteView = Backbone.View.extend({
		el: '.page',
		render: function(options) {
			var that = this;
			if(options.id) {
				var user = new UserModel({id:options.id});
				user.destroy({
					success: function(user){
						Backbone.history.navigate('', {trigger: true});
					}, 
					error: function(user, response){
						console.log(response.status);
					}
				});
			}
		}
	});
  // Returning instantiated views can be quite useful for having "state"
  return PersonDeleteView;
});